Repository navigation
Pre-calculate total geo area and time max limit for project groups - #780
Conversation
4e135bc to
b4f335a
Compare
9806151 to
5f8c32f
Compare
| required_count, | ||
| progress, | ||
| project_type_specifics | ||
| ) |
There was a problem hiding this comment.
I would have expected that we add the total group area max time here as well? Or is this done in another step?
There was a problem hiding this comment.
We are using Django for calculating this part. I have also added a comment mentioning that as well.
This can take some time to calculate and also doesn't work with existing ones as well.
So for now doing this on Django made more sense as it is calculated and maintained by Aggregated logic.
There was a problem hiding this comment.
mhh okay, not sure if I prefer this way to split it up. Could you investigate how long this will take for a single project during project creation.
I think it's "just" adjusting the sql statement slightly and summing up the task area per group with postgis. @ElJocho might be able to advise here as well.
There was a problem hiding this comment.
ideally the group information could be set directly when setting up the project, then we do not need to rely on django to perform additional steps at some point in time.
for backtrack calculation of existing projects your approach is good. I'm just concerned about new projects.
It is already difficult to understand which information is set for which project, e.g. considering the various project types. @ElJocho has worked towards refactoring this part of the code so that it will be easier to learn which attributes are expected.
There was a problem hiding this comment.
That makes sense, I wanted to add this to the group as well. Considering the refactor and complex structure right now I wanted to make minimal changes to the mapswipe_workers core part as well. Currently, the calculation/test parts also fit perfectly in the aggregated module as it is tightly coupled with it and only used there.
Maybe @ElJocho can move this aggregated logic to the core part when during the refactor. The SQL query is already defined, will just need to add it to the core logic and maybe define further tests as well. Which seems to be perfect on the refactoring part.
For backtrack calculation of existing projects your approach is good. I'm just concerned about new projects.
The aggregated module will calculate for old and new projects. Basically, if there are any projects with swipe data then the aggregated module will take care of it.
There was a problem hiding this comment.
perfect. sounds good to me then.
There was a problem hiding this comment.
Okay. I have merged this PR and created a new ticket (assigned @ElJocho there)
5f8c32f to
1798493
Compare
Changes
groupstable to use in aggregated data calculation. We are currently calculating this in fly for each calculation runWhy
Caching the geo areas decreases stat calculation time significantly.
For eg: For the whole 2022 year data (by calculating 1 month at a time), It took more than 5 days. After the current implementation, it took around 1-2 hours and the majority of time was spent on initial cache calculation.
Deployment steps